﻿//*** Guidance generated code ***//
using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;

using ProjectBase.Core;
using ProjectBase.Core.Web;

namespace ProjectBase.Mvc.Models
{
    /// <summary>
    ///     Base model for any controller using default UI infrastructure (MasterPage)
    /// </summary>
    public abstract class WebModel : CoreModel, IViewModel
    {
        /// <summary>
        ///     Model containing all needed data to allow Master Page work
        /// </summary>
        public virtual IMasterModel MasterModel { get; set; }
        /// <summary>
        ///     Name of the css class for content area
        ///     It allows to set different backgrounds for Detail, filter, List etc.
        /// </summary>
        public virtual string MasterBodyCssClass { get; set; }

        #region Validators
        /// <summary>
        ///     When IsNotEmpty(), its appended to the page head as a scirpt source.
        ///     The result should contain the validation rules:
        ///     validator.rules["LastName"] = { required: true, minlength: 1,maxlength: 50};
        /// </summary>
        public virtual string ValidationRulesJS { get; set; }
        #endregion Validators
    }
}